//
//  UIImage+resize.h
//  Postre
//
//  Created by CoderLT on 2017/5/27.
//  Copyright © 2017年 CoderLT. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (resize)
/**
 
 // 确定图片大小
 [imageView setImageWithURL:[NSURL URLWithString:@"xxx"]
 placeholder:[[UIImage imageNamed:@"defaultEmpty"] resizeToSize:imageView.size]];
 
 // 确定图片尺寸比例
 [imageView setImageWithURL:[NSURL URLWithString:@"xxx"]
 placeholder:[[UIImage imageNamed:@"defaultEmpty"] resizeBySizeRatio:CGSizeMake(1, 2)]];
 
 */

/**
 图片缩放, 默认居中占缩放后大小的60%, 背景填充色 #EEEEEE

 size 缩放后的图片大小 resizeBySizeRatio: 按照目标的宽高比例去缩放
 @return 缩放后的图片
 */
- (instancetype)resizeToSize:(CGSize)size;
- (instancetype)resizeBySizeRatio:(CGSize)size;

/**
 图片缩放, 居中显示

 size 缩放后的大小
 insets 边距控制
 color 背景填充
 @return 新的图片
 */
- (instancetype)resizeToSize:(CGSize)size contentInsets:(UIEdgeInsets)insets backgroundColor:(UIColor *)color;

- (instancetype)imageCircle;


/**
 获取启动
 */
+ (UIImage *)launchImage;

/**
 UIImage 转化成 CVPixelBufferRef
 */
- (CVPixelBufferRef)pixelBuffer;
@end
